<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table border="1">
  <caption>个人信息</caption>
  <tr>
    <td>照片</td>
    <td id="head_id"></td>
  </tr>
  <tr>
    <td>名字:</td>
    <td id="name_id"></td>
  </tr>
  <tr>
    <td>年龄</td>
    <td id="age_id"></td>
  </tr>
  <tr>
    <td>好友:</td>
    <td id="friend_id"></td>
  </tr>
</table>
<input type="button" value="请求数据" onclick="f()">
<script>
  function f() {
    let person = {name:"苍老师",age:18,url:"../day04/a.jpg",friends:["传奇","克晶","成恒"]}
    let img = document.createElement("img");
    img.src = person.url;
    head_id.append(img);
    name_id.innerText = person.name;
    age_id.innerText = person.age;
    let ul = document.createElement("ul");
    for (let friend of person.friends) {
      let li = document.createElement("li");
      li.innerText = friend;
      ul.append(li);
    }
    friend_id.append(ul);
  }



</script>
</body>
</html>